package at.fhj.swd.pse.entities;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

@Entity
public class FriendActivity extends Activity {

	/**
    * 
    */
	private static final long serialVersionUID = 1L;

	@ManyToOne
	private User friend;

	@Override
	public String toString() {
		String result = this.getClass().getSimpleName() + " ";
		result += "serialVersionUID: " + serialVersionUID;
		return result;
	}

	public User getFriend() {
		return this.friend;
	}

	public void setFriend(final User friend) {
		this.friend = friend;
	}

	@Override
	public String getHtmlDescription() {
		return super.getCreator().getFirstName() + " " + super.getCreator().getLastName() + " has added " + this.friend.getFirstName() + " " + this.friend.getLastName() + " to his Friends.";
	}

	@Override
	public String getHtmlTargetUrl() {
		return "user.xhtml?id=" + this.friend.getId();
	}

}
